﻿using System;

namespace TicTacToe._3D
{
    sealed class Triple : Tuple<int, int, int>
    {
        public Triple(int item1, int item2, int item3)
            : base(item1, item2, item3)
        {
        }

        public static bool operator ==(Triple t1, Triple t2)
        {
            return t1.Item1 == t2.Item1 &&
                   t1.Item2 == t2.Item2 &&
                   t1.Item3 == t2.Item3;
        }

        public static bool operator !=(Triple t1, Triple t2)
        {
            return !(t1 == t2);
        }

        public override bool Equals(object obj)
        {
            if (obj is Triple)
                return this == (Triple)obj;
            return base.Equals(obj);
        }

        public override int GetHashCode()
        {
            return Item1.GetHashCode()^Item2.GetHashCode()^Item3.GetHashCode();
        }
    }
}
